#include <header.h>

pthread_mutex_t lock;

void *run(void *p){
	pthread_mutex_lock(&lock);
	printf("child\n");
	sleep(1);
	pthread_mutex_unlock(&lock);
	return NULL;
}


int main(int argc, char* argv[]){
	ARGS_CHECK(argc, 1);

	pthread_mutex_init(&lock, NULL);
	pthread_t p;
	pthread_create(&p, NULL, run, NULL);


	pthread_mutex_lock(&lock);
	printf("main\n");
	sleep(1);
	pthread_mutex_unlock(&lock);

	pthread_join(p, NULL);
	return 0;
}